/*
 *  Copyright 2012 yura.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package org.opu.pc.sg;

import java.util.Collection;
import java.util.Date;
import org.opu.pc.bl.BibliographyLinkService;
import org.opu.pc.domain.PublicationManagement;
import org.opu.pc.domain.domains.Publication;

/**
 *
 * @author Yuriy Dunko
 */
public class ProfessorStatementGenerator extends StudentStatementGenerator{

    public static final String VAC_PUBLICATION = "vac";
    public static final String PROFESSOR_ID = "professorId";
    

    public ProfessorStatementGenerator(BibliographyLinkService linkService,
            PublicationManagement publicationManagement){
        super(linkService, publicationManagement);
    }


    @Override
    protected String prepareBLink(String link, Publication publication){
//        if (publication.isWasApplied()){
//            link = new StringBuilder().append(link).append(" (")
//                    .append(sgProperties.getProperty(VAC_PUBLICATION))
//                    .append(')').toString();
//        }
        return link;
    }

    @Override
    protected Collection<Publication> getPublications(){
        return publicationManagement.getProfessorPublications(
                (Date)variables.get(BEGIN_YEAR_VAR),
                (Date)variables.get(END_YEAR_VAR),
                (Integer)variables.get(PROFESSOR_ID));
    }
}
